<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <div>a</div>
    <div>b</div>
    <div>c</div>
    <div>d</div>
    <div>e</div>
</div>

<script src="vue.js"></script>
<script>
    new Vue({
      el:'#app',
      mounted(){
        let arr=document.getElementById('app').getElementsByTagName('div');
        let a=0;
        console.log(arr);
        for(let i in arr){
          a++;
          console.log(i);
          arr[i].onclick=function () {
            console.log(i);
          }
        }
        console.log(a);
      }
    })
</script>
</body>
</html>